package top.wilsonlv.jaguar.cloud.auth.sdk.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import top.wilsonlv.jaguar.cloud.auth.sdk.dto.CredentialMatchEntity;
import top.wilsonlv.jaguar.cloud.auth.sdk.dto.CredentialMatchResult;
import top.wilsonlv.jaguar.commons.web.response.JsonResult;

/**
 * @author lvws
 * @since 2022/1/13
 */
@FeignClient(value = "jaguar-auth-server", contextId = "remoteArcFaceService")
public interface RemoteArcFaceService {

    /**
     * 人脸比对
     *
     * @param credentialMatchEntity 对比实体
     * @return 比对结果
     */
    @PostMapping("/feign/face/compareFace")
    JsonResult<CredentialMatchResult> compareFace(@RequestBody CredentialMatchEntity credentialMatchEntity);

    /**
     * 人脸特征比对
     *
     * @param credentialMatchEntity 对比实体
     * @return 比对结果
     */
    @PostMapping("/feign/face/compareFeature")
    JsonResult<CredentialMatchResult> compareFeature(@RequestBody CredentialMatchEntity credentialMatchEntity);

    /**
     * 人脸比对特征
     *
     * @param credentialMatchEntity 对比实体
     * @return 比对结果
     */
    @PostMapping("/feign/face/compareFeatureWithFace")
    JsonResult<CredentialMatchResult> compareFeatureWithFace(@RequestBody CredentialMatchEntity credentialMatchEntity);

    /**
     * 检测并获取人脸特征
     *
     * @param face              人脸信息
     * @param multipleException 多脸是否成功
     * @return 人脸特征
     */
    @PostMapping("/feign/face/check")
    JsonResult<String> check(@RequestBody String face, @RequestParam("multipleException") Boolean multipleException);
}
